package com.learn.algorithm.designpattern.builder;

/**
 * @author wangxing
 * @version 2020/8/20 6:22 Administrator
 */
public class DefaultProductBuilder implements IProductBuilder{
    private Product product;

    public DefaultProductBuilder() {
        product = new Product();
    }

    @Override
    public IProductBuilder productNameBuilder(String name) {
        product.setProductName(name) ;
        return this;
    }

    @Override
    public IProductBuilder factoryNameBuilder(String factoryName) {
        product.setFactoryName(factoryName);
        return this;
    }

    @Override
    public IProductBuilder park1Builder(String park1) {
        product.setPark1(park1);
        return this;
    }

    @Override
    public IProductBuilder park2Builder(String park2) {
        product.setPark2(park2);
        return this;
    }

    @Override
    public IProductBuilder park3Builder(String park3) {
        product.setPark3(park3);
        return this;
    }

    @Override
    public IProductBuilder park4Builder(String park4) {
        product.setPark4(park4);
        return this;
    }

    @Override
    public Product builder() {
        return product;
    }
}
